/*
 * Function to ask or generate an array
 */
#include <stdio.h>
#include <time.h>
#include "define.h"
void read_array(int a[])
{
	int option, i, n, b = ARRAYSIZE;
	printf( "Enter (1) to autogenerate an array of %d elements\n", b);
	printf( "Enter (2) to input yourself the elements\n");
	scanf("%d", &option);
	switch (option){
		case 1:
			srand(time(0));
			for (i = 0; i < ARRAYSIZE - 1; i++){
				a[i] = random() % MAXVALUE;
			}
			break;
		case 2:
			for (i = 0; i < ARRAYSIZE - 1; i++){
				printf("Enter the element %d:", i);
				scanf("%d", &n);
				a[i] = n;
			}
			break;
	}
}
